home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
16
/
interval.fth
< prev
next >
Wrap
Text File
|
1985-11-19
|
1KB
|
31 lines
\ Attempt to rationally (is that possible?) deal with time intervals
hex
\ This variable counts the number of 5 msec timer ticks
\ The manual says that this variable is at 4bc but it's really
\ at 4ba on my system
: get-ticks ( -- timer-ticks ) 4ba l@ ;
5 constant ms/tick ( -- n )
td 1000 ms/tick / constant ticks/second ( -- )
\ This is not done with the existing comparison operators because
\ we want to allow arbitrary crossings of the positive-to-negative
\ boundaries of the number circle
: reached? ( target -- ticks>=target? )
get-ticks - 0<
;
: ms ( n -- ) \ Delay for at least n milliseconds
ms/tick / ( #ticks )
1+ \ Delay at least 1 tick
get-ticks + ( target )
begin pause dup reached? until
drop
;
-index ( -- ) \ filename
reading
index /index th ff fill
last-char off
begin 1line until